package ObjectInputStream;

import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.List;

public class ObjectInputStreamTest {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("./users");
        ObjectInputStream ois = new ObjectInputStream(fis);
        Object obj = ois.readObject();

        List<User> list = (List<User>)obj;
        for (User temp: list) {
            System.out.println(temp);
        }
    }
}
